
package com.market.service;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import com.market.bean.Supplier;

public class SupplierServiceImpl extends BaseServiceImpl implements ISupplierService
{
    /*
     * (non-Javadoc)
     * 
     * @see com.market.service.ISupplierService#findById(long)
     */
    public Supplier findById(long id)
    {
        return getSupplierDAO().findById(id);
    }

    public List getSupplier()
    {
        DetachedCriteria detachCri = DetachedCriteria.forClass(Supplier.class);
        detachCri.add(Restrictions.eq("isfamous", Boolean.valueOf(true)));
        return getSupplierDAO().findByDetchedCriteria(detachCri, 0, 0);
    }
}
